package com.mes.cloud.common;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.SerializationFeature;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * @Description TODO
 * @author: wxm
 * @date: 2020/1/5 15:46
 * @version: 1.0
 */
public class ExtandObjectMapper extends ObjectMapper {
    private static final long serialVersionUID = 4402127997078513582L;

    public ExtandObjectMapper() {
        this.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
        this.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.setDateFormat(df);
        this.setPropertyNamingStrategy(PropertyNamingStrategy.SNAKE_CASE);
    }
}
